<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>layui</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css" media="all">
		<link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" media="all" />
		<link rel="stylesheet" href="__CSS__/admin.css" media="all">
		<style type="text/css">
			/* tooltip */
			
			#tooltip {
				position: absolute;
				border: 1px solid #ccc;
				background: #333;
				padding: 2px;
				display: none;
				color: #fff;
			}
			
			.layui-btn-danger {
				background-color: #2BB6F6;
			} 
		</style>
	</head>

	<body style="padding:10px;">
		<div class="tplay-body-div">
			<div class="layui-tab">
				<ul class="layui-tab-title">
					<li class="layui-this">会员等级列表</li>
					<li><a href="{:url('admin/member/leveladd')}" class="a_menu">新增会员等级</a></li>
				</ul>
			</div> 
			<form class="layui-form serch" action="{:url('admin/member/level')}" method="post">
				<div class="layui-form-item" style="float: left;"> 
					<div class="layui-input-inline">
						<input type="text" name="name" lay-verify="title" autocomplete="off" placeholder="等级名称" class="layui-input layui-btn-sm">
					</div> 
					<button class="layui-btn layui-btn-danger layui-btn-sm" lay-submit="" lay-filter="serch">查询</button>
				</div>
			</form>
			<table class="layui-table" lay-size="sm">
				<colgroup>
					<col width="100">
					<col width="100">
					<col width="100">
					<col width="100">
					<col width="100">
					<col width="100">
					<col width="100">
					<col width="100">
					<col width="100">
				</colgroup>
				<thead>
					<tr>
						<th>等级名称</th> 
						<th>即时赠送</th>
						<th>后续赠送</th> 
						<th>赠送年限</th> 
						<th>活动时期</th>
						<th>创建时间</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody> 
					{volist name="list" id="vo"}
					<tr>
						<td>{$vo.name}</td> 
						<td>{$vo.num1}</td> 
						<td>{$vo.num*$vo.zs_date}</td> 
						<td>{$vo.zs_date1+$vo.zs_date}</td> 
						<td>{$vo.date == 0 ? "永久" : "限时"}</td>
						<td>{$vo.add_time}</td> 
						<td>
							<a href="{:url('admin/member/leveledit',['id'=>$vo.id])}" style="font-size:12px;color: #2BB6F6;">编辑</a> 
							<a href="javascript:;" onclick="leveldlt('{$vo.id}')" style="font-size:12px;color: #2BB6F6;">删除</a> 
						</td>
					</tr>
					{/volist}
				</tbody>
			</table>
			<div style="padding:0 20px;">{$list->render()}</div>

			{include file="public/foot"} 
			<script>
				function leveldlt(id){ 
					var lay = layer.confirm('确定要删除吗?', {
						icon: 3,
						title: '提示'
					}, function(index) {
						$.ajax({
							type: 'post',
							url: "{:url('member/leveldlt')}",
							dataType: 'json',
							data: {
								id: id 
							},
							success: function(data) { 
								  if(res.code == 1) {
			                            layer.msg(res.msg, function(index){
			                                location.href = res.url;
			                            })
			                        } else {
			                              layer.msg(res.msg);
			                        }
							}
						});
					});
				}
			</script>
		</div>
	</body>

</html>